Skip to content

Change FuzzySearch service to a concern#302

Merged
lmrodriguezr merged 2 commits into
mainfrom
fuzzy-search-concern
Jun 30, 2026
Merged

Change FuzzySearch service to a concern#302
lmrodriguezr merged 2 commits into
mainfrom
fuzzy-search-concern

Conversation

@vangberg

Copy link
Copy Markdown
Contributor

A few changes here:

  1. FuzzySearch service moved to a concern.
  2. Renamed Name#fuzzy_match to Name#fuzzy_search to reflect name of the concern. Yes/no?
  3. Changed query to use sanitize_sql_array so we can just pass around the initial query.

Needed for Zeitwerk (#268)

@vangberg vangberg requested a review from lmrodriguezr June 30, 2026 09:50
Comment thread test/fixtures/names.yml Outdated
@@ -1,4 +1,30 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
<% status = ->(symbol) { Name.status_hash.find { |_, attrs| attrs[:symbol] == symbol }.first } %>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit clever, but I prefer the readability of status: <%= status.call(:seqcode) %> over status: 15 e.g.

This was referenced Jun 30, 2026
@lmrodriguezr lmrodriguezr merged commit ecd082f into main Jun 30, 2026
4 checks passed
@lmrodriguezr lmrodriguezr deleted the fuzzy-search-concern branch June 30, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants